package ink.feny.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;


@RefreshScope
@RestController
public class IndexController {
    @Autowired
    private RestTemplate restTemplate;
    @Value("${msg}")
    private String msg;

    @GetMapping("getMsg")
    public String getMsg() {
        return msg;
    }

    @GetMapping("getName")
    public String geConName() {
        return restTemplate.getForObject("http://NACOS-DEMO-ONE/getName", String.class);
    }
}
